package jp.seraph.jsmf.codec;

import java.util.Arrays;
import java.util.List;

import jp.seraph.jsade.model.AngleVelocityCalculator;
import jp.seraph.jsade.model.JointIdentifier;
import jp.seraph.jsmf.message.MessageUtil;

public class PoseNameLinkMotionElementData {
    public PoseNameLinkMotionElementData(String aName, String aPoseName, String aConditionElementName, int aStartPercentage, AngleVelocityCalculator aCalculator, JointIdentifier... aIdentifiers){
        this(aName, aPoseName, aConditionElementName, aStartPercentage, aCalculator, Arrays.asList(aIdentifiers));
    }

    public PoseNameLinkMotionElementData(String aName, String aPoseName, String aConditionElementName, int aStartPercentage, AngleVelocityCalculator aCalculator, List<JointIdentifier> aIdentifiers){
        if(mStartPercentage < 0 || 100 < mStartPercentage)
            throw new IllegalArgumentException(MessageUtil.illegalArgumentRange("aStartTiming", "0", "100"));

        mName = aName;
        mPoseName = aPoseName;
        mConditionElementName = aConditionElementName;
        mStartPercentage = aStartPercentage;
        mCalculator = aCalculator;
        mIdentifiers = aIdentifiers;
    }

    private String mName;
    private String mPoseName;
    private String mConditionElementName;
    private int mStartPercentage;
    private AngleVelocityCalculator mCalculator;
    private List<JointIdentifier> mIdentifiers;

    public String getName(){
        return mName;
    }

    public String getPoseName(){
        return mPoseName;
    }

    public String getConditionElementName(){
        return mConditionElementName;
    }

    public int getStartPercentage(){
        return mStartPercentage;
    }

    public List<JointIdentifier> getIdentifiers(){
        return mIdentifiers;
    }

    public AngleVelocityCalculator getCalculator(){
        return mCalculator;
    }
}
